define(['jquery', 'kindeditor', 'kindeditor_zh_CN'], function ($, KindEditor, undefined) {
    var editor = {};
    if ($('.editor').size() > 0) {
        $.each($(".editor"), function (k, v) {
            var id = $(v).attr('id');
            id = '#' + id;
            editor[id] = KindEditor.create(id, {
                basePath: '/static/backend/libs/kindeditor/',
                uploadJson: '/ajax/editorUpload',
                fileManagerJson: '/ajax/editorUpload',
                extraFileUploadParams: {},
                width: "100%",
                filterMode:false
            });

        })
        //自定义插件 后面在搞吧
        // KindEditor.plugin('hello', function (K) {
        //     var editor = this, name = 'hello';
        //     // 点击图标时执行
        //     editor.clickToolbar(name, function () {
        //         editor.insertHtml('你好');
        //     });
        // });
        // KindEditor.lang({
        //     hello: '你好'
        // });
        window.KindEditor = KindEditor;
    }

});
